<div class="small right box">
	<h1 style="background-color:#<?php echo $category->color ?>">
		<img src="uploads/icon/head/<?php echo $category->image ?>" />
		<span><?php echo $category->name ?></span>
		<a class="more" href="contents/index/<?php echo $category->id ?>">ดูทั้งหมด</a>
		<div class="corner_left"></div>
		<div class="corner_right"></div>
	</h1>
	<ul>
		<?php foreach($contents as $key => $content): ?>
		<li>
			<?php if($content->url): ?>
			<a target="_blank" href="<?php echo $content->url ?>">
			<?php else: ?>
			<a href="contents/view/<?php echo $content->id ?>">
			<?php endif; ?>
				<img src="uploads/content/thumbnail/<?php echo $content->image ?>" />
				<h2><?php echo $content->title ?></h2>					
			</a>
			<div class="clear"></div>
		</li>		
		<?php endforeach; ?>
	</ul>
</div>
<div class="clear"></div>